import {request} from '@umijs/max';
import {HostComputerListItem} from "@/pages/power/host-computer/list/data";

/** 更新sku信息 PUT /api/hostComputer/edit */
export async function hostComputerEdit(data: { [key: string]: any }, options?: { [key: string]: any }) {
    return request<HostComputerListItem>('/api/hostComputer/edit', {
        data,
        method: 'POST',
        ...(options || {}),
    });
}

/** 角色列表 POST /api/hostComputer/detail */
export async function hostComputerDetail(
    params: {
        hostComputerId?: string;
    },
    options?: { [key: string]: any },
) {
    return request<{
        data: HostComputerListItem;
    }>('/api/hostComputer/detail', {
        method: 'GET',
        params: {
            ...params,
        },
        ...(options || {}),
    });
}

export async function hostComputerConfigNetwork(data: { networkIdList: string[],hostComputerId: string }, options?: { [key: string]: any }) {
    return request<API.ApiResponse>('/api/hostComputer/configNetwork', {
        data,
        method: 'POST',
        ...(options || {}),
    });
}

